#lang racket/base
(require
 (for-syntax
  racket/base
  spire/core/expander
  spire/core/transformers/toplevel-definition)
 rackunit
 racket/base
 spire/core/literals
 "util/check-expansion.rkt")

(begin-for-syntax
  (struct eg-top-def []
    #:property prop:toplevel-definition
    (λ (self id) 0)
    #:property prop:procedure
    (λ (self stx)
      (raise-syntax-error #f "expansion of toplevel!" stx))))

(define-syntax t (eg-top-def))

(check-identity-expansion
 t
 expand-expression)

(check-expansion
 (t 1)
 (#%sp:app t (#%sp:datum 1))
 expand-expression)
